<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>孩子界面</title>
<link rel="stylesheet" type="text/css" href="../Public/growth/jquery.jqplot.css" />
<script type="text/javascript" src="../Public/js/jquery-1.7.1.min.js"></script>
<script language="javascript" type="text/javascript" src="../Public/growth/jquery.jqplot.js"></script>
<script src="../Public/growth/excanvas.js" type="text/javascript"></script>
<script src="../Public/growth/jqplot.dateAxisRenderer.js" type="text/javascript"></script>
<script type="text/javascript" src="../Public/growth/jqplot.cursor.js"></script>
<script type="text/javascript" src="../Public/growth/jqplot.dateAxisRenderer.js"></script>
<script type="text/javascript" src="../Public/growth/jqplot.highlighter.js"></script>
<script type="text/javascript">

 function toChild(uid)
{
  var url = "getChild/uid/"+uid;
  window.location.href = "{:U('"+url+"')}";  
} 

  function selectitem(index)
 {
   var userid = $('#userid').val();
   switch(index){
    case 1:
    $('#tab2').html('');
    $.post("{:U('Child/getAlbum')}",{userid:userid},function(data){
        var jsonObj = $.parseJSON(data);
        var jsonDatas = jsonObj.data;
        if(jsonDatas ==null)
        {
           $('#tab2').append("</br><div style='color:#047f80'>Ta没有上传图片！！</div>"); 
        }
        else
        {
         document.getElementById("tab1").style.display="none";;       
        for(var i=0;i<jsonDatas.length;i++ )
        {
            $('#tab2').append("<div style='float:left;width:120px;margin-left:10px;margin-left:10px;border:solid 1px;padding: 5px;background:#ffffff;'>	<div class='img_container' ><img src='../Public/upload/"
                   +jsonDatas[i]['picture']+"'onclick='toPicture("+jsonObj.info+","+jsonDatas[i]['id']+")'style='width: 120px;height:130px; cursor:pointer;' /></div><div class='img_name myfontstyle'>"
                   +jsonDatas[i]['albumname']+"</div></div>");
               
        }
        
       }
        //$('#tab2').html(htmls);		
    });
    break;
    case 2:
    $('#tab2').html('');
    $.post("{:U('Child/getNote')}",{userid:userid},function(data){
        document.getElementById("tab1").style.display="none";
        var jsonObj = $.parseJSON(data);
        var jsonDatas = jsonObj.data;
        if(jsonDatas ==null)
        {
          $('#tab2').append("</br><div class='myfontstyle' style='color:#047f80'>Ta没有写博文！！</div>");
        }
        else
        {       
            for(var i=0;i<jsonDatas.length;i++ )
            {
              $('#tab2').append("<div class='myfontstyle' style='width:95%;margin-left:5px;margin-top:10px; height:100px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;'><div style='float:left;width:100%'><div style='float:right;width:100%;'><div style='width:100%;height:36px;'>"
                        +"<div style='float:left;background:url(../Public/discuss/image/m_greenline.png) repeat-x left bottom;width:100%;height:36px; line-height:36px;color:#24b33b;font-weight:bold;'><a href='#' style='font-size:13pt;' onclick='selectArticle('"
                        +jsonDatas[i]['n_id']+">"+jsonDatas[i]['title']+"</a></div><div style='background:url(../Public/discuss/image/greenline.png) no-repeat left bottom;height:30px; line-height:30px;color:#888888;font-size:11pt; font-style:oblique;'></div></div><div style='float:right;height:50px;width:100%;font-size:10pt;color:#8b8c8e;padding-top:10px;'>"
                        +jsonDatas[i]['p_name']['name']+"&nbsp;&nbsp;"+jsonDatas[i]['ctime']+"</div></div></div></div>");
            }
        }		
    });
    break;
    case 3:
    $('#tab2').html('');
    $.post("{:U('Child/getFirst')}",{userid:userid},function(data){
        document.getElementById("tab1").style.display="none";
        var jsonObj = $.parseJSON(data);
        var jsonDatas = jsonObj.data;
        if(jsonDatas ==null)
        {
          $('#tab2').append("</br><div class='myfontstyle' style='color:#047f80'>Ta还没有分享里程碑！！</div>");
        }
        else
        {       
            for(var i=0;i<jsonDatas.length;i++ )
            {
              $('#tab2').append("<div class='myfontstyle' style='color:#7f7f7f' id="+jsonDatas[i]['id']
                                +"'><span style='color:#047f80'>"+jsonDatas[i]['p_name']['name']
                                +"</span>第一次<span style='color:#047f80;' id='item_"+jsonDatas[i]['id']+"'>"+jsonDatas[i]['tag']+"</span>是在<span style='color:#047f80;'>"+jsonDatas[i]['content']+"</span>这个激动人心的时刻</div>");
            }
        }		
    });
    break;
    case 4:
    $('#tab2').html('');
    $.post("{:U('Child/getFavourite')}",{userid:userid},function(data){
        document.getElementById("tab1").style.display="none";
        var jsonObj = $.parseJSON(data);
        var jsonDatas = jsonObj.data;
        if(jsonDatas ==null)
        {
          $('#tab2').append("</br><div class='myfontstyle' style='color:#047f80'>Ta还没有分享自己的最爱！！</div>");
        }
        else
        {       
            for(var i=0;i<jsonDatas.length;i++ )
            {
              $('#tab2').append("<div class='myfontstyle' style='color:#7f7f7f' id="+jsonDatas[i]['id']
                                +"'><span style='color:#047f80'>"+jsonDatas[i]['p_name']['name']
                                +"</span>最喜爱的<span style='color:#047f80;' id='item_"+jsonDatas[i]['id']+"'>"+jsonDatas[i]['item']+"</span>是<span style='color:#047f80;'>"+jsonDatas[i]['content']+"</span></div>");
            }
        }		
    });
    break;
    case 5:
    $('#tab2').html('');
    $.post("{:U('Child/videolist')}",{userid:userid},function(data){
        document.getElementById("tab1").style.display="none";
        var jsonObj = $.parseJSON(data);
        var jsonDatas = jsonObj.data;        
         if(jsonDatas ==null)
        {
          $('#tab2').append("</br><div class='myfontstyle' style='color:#047f80'>Ta没有分享视频！！</div>");
        }
        else
        {       
            for(var i=0;i<jsonDatas.length;i++ )
            {
              $('#tab2').append("<div class='myfontstyle' style='width:95%;margin-left:5px;margin-top:10px; height:100px;background:url(../Public/discuss/image/line.png) repeat-x left bottom;'>"+
                            "<a href="+jsonDatas[i]['play_url']+" style='font-size:13pt;'>"+jsonDatas[i]['title']+"</a></div>");
            }
        }
    });
    break;
    case 6:
    $('#tab2').html('');
    document.getElementById("tab1").style.display="none";
    $('#tab2').html("<div id='chart' style='height:200px;width:500px;'></div><div id='chartdiv' style='height:200px;width:500px;'></div>");   
    $.post("{:U('Child/getShowth')}",{userid:userid},function(data){
        var jsonObj = $.parseJSON(data);
        if(jsonObj.data==null){
            $('#chart').html("<b class='myfontstyle' style='color:#047f80'>Ta还没有输入升高和体重！</b>");
        }
        else
        {
        var jsonDatas = jsonObj.data;        
        var jsons = [];
        var jsonw = [];
        var times = [];
        $('#chart').html('');
        $('#chartdiv').html('');
        for(var i=0;i<jsonDatas.length;i++ )
        {
            jsons.push(jsonDatas[i]['height']);
            jsonw.push(jsonDatas[i]['weight']);
            times.push(jsonDatas[i]['time']);
        }
         $.jqplot('chart',  [jsons],{
            title:'身高生长曲线',
            axisDefaults: {
                show:false, 
                tickOptions: {
                  showMark:true       
              } //tickOptions结束
         },//axisDefaults结束
         axes: {

           yaxis:{
               show:false,
               max:200,
               min:20,
               tickOptions: { 
                  fontFamily:'CM' //刻度值上字体   
               }
           }//yaxis
         },//axes
         cursor: {
          show: true,
          tooltipLocation:'sw'
        }
   });
         $.jqplot('chartdiv', [jsonw],{
            title:'体重生长曲线',
            axisDefaults: {
                show:false,   
                tickOptions: {
                  showMark:true       
              } //tickOptions结束
         },//axisDefaults结束
         axes: {
           yaxis:{
               show:false,
               max:90,
               min:0,
           }
         },
          cursor: {
          show: true,
          tooltipLocation:'sw'
        }
       });
      }  
    }); 
    break;
    case 7:
     var userid = $('#userid').val();
     $.post("{:U('Child/getInfo')}",{userid:userid},function(data){       
        var jsonObj = $.parseJSON(data);
         $('#tab2').html('');
         document.getElementById("tab1").style.display="none";
        if(jsonObj.data==null){
             $('#tab2').html("</br><div class='myfontstyle' style='color:#047f80'>该婴儿还没有输入详细的个人信息！</div>"); 
        }
        else
        {
           $('#tab2').html("</br><div class='myfontstyle' style ='margin-left:%5;color:#7f7f7f'><span style='color:#047f80;'>昵&nbsp;&nbsp;&nbsp;&nbsp;称：</span>"+jsonObj.data['nick']+"</br></br><span style='color:#047f80;'>名字寓意：</span>"+jsonObj.data['namemean']+"</br></br><span style='color:#047f80;'>省市医院：</span>"+jsonObj.data['province']+',&nbsp;&nbsp;&nbsp;&nbsp;'+jsonObj.data['hospital']+"</br></br><span style='color:#047f80;'>眼睛颜色：</span>"+jsonObj.data['eyecolor']+"</br></br><span style='color:#047f80;'>头发颜色：</span>"+jsonObj.data['haircolor']+"</br></br><span style='color:#047f80;'>学校老师：</span>"
        +jsonObj.data['school']+'幼儿园,&nbsp;&nbsp;'+jsonObj.data['teacher']+',&nbsp;&nbsp;&nbsp;&nbsp;'+jsonObj.data['course']+"</br></br><span style='color:#047f80;'>兴趣爱好：</span>"+jsonObj.data['activity']+"</br></br><span style='color:#047f80;'>其&nbsp;&nbsp;&nbsp;&nbsp;他:</span>"+jsonObj.data['special']+'</div>');
   
        }
    
    });
    
    break;
   }
}


 function toPicture(uid,aid){
    alert("您还没有登录，请先登录！");
    window.location.href="{:U('Public/land')}"
   // var url = "toList/uid/"+uid+"/aid/"+aid;
//    alert("{:U('"+url+"')}");
//    window.location.href="{:U('"+url+"')}";
 } 
 function selectArticle(id){
     alert("您还没有登录，请先登录！");
    window.location.href="{:U('Public/land')}"
   // var url="noteinfo/n_id/"+id;
//    window.location.href="{:U('"+url+"')}";
 }
 function toOnePicture(picid){
    alert("您还没有登录，请先登录！");
    window.location.href="{:U('Public/land')}"
    }  
 function selectArticle(id){
     alert("您没有登录，请先登录！");
     window.location.href="{:U('Public/land')}"
} 
function toRegister()
{
     window.location.href="{:U('Public/register')}";
}
function toLogin()
{
     window.location.href="{:U('Public/land')}";
}
</script>
<style>

div{
	margin:0px;
	margin-left:auto;
	margin-right:auto;
	}
body {
	background:#ffffff;
	margin:0px;	

}
a {
	text-decoration: none;
	color:#036e6c;
	font-size:9pt;
}
input{
	background:#f2fbfe;
	}
#top_title{
	width:100%;
	height:74px;
	}
#manager_title{
	width:100%;
	margin-left:2%;
	}	
.acbu{
	margin-left:3%;
	margin-top:8px;
	height:80%;
	width:50px;
	background:#087db6;
	float:left;
	}	
.title_b{
	height:34px;
	float:left;
	cursor:pointer;
	}	
.record{
	width:100%;
	height:40px;
	float:left;
	}	
.record div{
	margin-left:3%;
	}
.upd{
	color:#D0D0D0;
	font-style:oblique;
	height:40px;
	float:left;
	line-height:40px;
	}
.ce{
	width:70%;
	}	
.ti{
	width:23%;
	}
.de_c{
	width:90%;
	height:28px;
	}	
.select_page{
	background-color:#999;
	}		
.options{
	height:30px;
	width:170px;
	border-bottom:dotted #e3e3e3 1px;
	cursor:pointer;
	}
.img_container{
	width:100%;
	}
.img_name{
	width:100%;
	height:20px;
    margin-top: 10px;
	}
.myfontstyle{
    font-family:'黑体';
    letter-spacing:1px;
}			
</style>

<body>
<div style="width:67%;float:left;margin-top:20px;">
	<div id='top_title'>  
		<div style='float:left;width:141px;height:74px;background:url(../Public/images/child/logo.png) no-repeat;margin-left:20px;'></div>
    	<div style='float:right;width:550px;height:74px;background:url(../Public/images/child/tell.png) no-repeat;cursor:pointer;'></div> 
	</div>

	<div id="manager_title">
      <div class="title_b" style="background:url(../Public/child/image/flush.png) no-repeat;width:74px;"></div>
       <div class="title_b" style="background:url(../Public/child/image/magzine.png) no-repeat;width:57px;" onclick="selectitem(2)"></div>
       <div class="title_b" style="background:url(../Public/child/image/photo.png) no-repeat;width:57px;" onclick="selectitem(1)"></div>
       <div class="title_b" style="background:url(../Public/child/image/video.png) no-repeat;width:57px;" onclick="selectitem(5)"></div>
       <div class="title_b" style="background:url(../Public/child/image/favorite.png) no-repeat;width:57px;" onclick="selectitem(4)"></div>       
       <div class="title_b" style="background:url(../Public/child/image/first.png) no-repeat;width:63px;" onclick="selectitem(3)"></div>    
       <div class="title_b" style="background:url(../Public/child/image/increase.png) no-repeat;width:79px;" onclick="selectitem(6)"></div>
       <div class="title_b" style="background:url(../Public/child/image/details.png) no-repeat;width:79px;" onclick="selectitem(7)"></div> 
    </div>
    

<div id='main' style="float:left;width:100%;margin-top:10px;"> 
<input type="text" id="userid" name="userid" value="{$userid}" style="display:none;" /> 
  <div style="background:#E8F7FE;height:60px;width:98%;margin-left:2%;">      
            <div id='childmain' style="float:left;width:90%;height:40px;margin-top:10px;">
				<div id="childname" style="width:15%;border-right:solid thin #b9b9b9;height:40px;float:left; text-align:left;line-height:40px;margin-left:3%;font-weight:bold;color:#6c6c6c;font-size:16pt;">{$user.name}</div>
		           <div style="margin-left:8px;line-height:40px; font-size:15pt;color:#6c6c6c;height:40px;;width:78%;float:left;">
					<div style="width:16px;height:30px;background:url(../Public/child/image/birthcake.png) center center no-repeat;float:left;"></div>
					<div class="myfontstyle" style="float:left;text-align:left;font-size:10pt;">{$shareList.content}<b style="font-size:7pt;margin-left:10px;">{$shareList.ctime}</b></div>					
			  </div>
			</div>
  </div>   
<!-- 第一栏结束-->
<!--tab换开始-->
  <div id="tab1" style="width:98%;margin-left:2%;">
    <div class="record" style="background:#f2fafa;">
    	<div style="width:16px;height:40px;background:url(../Public/child/image/smile.png) center center no-repeat;float:left;"></div>
		<div style="float:left; text-align:left;font-weight:bold;color:#7f7f7f;line-height:40px;">Ta最新的信息哦</div>
    </div>
    <div class="record"></div>
    <div class="record"><div class="upd ce"><img src="../Public/upload/{$plist.ph_name}" style="width:100px;height:50px;cursor:pointer;" onclick="toOnePicture({$plist.id})" /></div>
    <div class="upd ti">{$plist.ctime}</div></div>
    <div class="record"><div id="shareid" class="upd ce"></div>
    <div id="timeid" class="upd ti"></div></div>
    <div class="record"><div class="upd ce" style="cursor:pointer;" onclick="selectArticle({$nlist.n_id})">{$nlist.title}</div>
    <div class="upd ti">{$nlist.ctime}</div></div>
  </div>
  <div id="tab2" style="width:98%;margin-left:2%;margin-top:2%;">
</div> 
</div>
</div>
<div style="float:left;width:6%;background:url(../Public/child/image/m_line.png) no-repeat right center;height:600px;margin-top:20px;"></div>
<div style="float:left;width:27%;margin-top:20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>

		<div style="width:160px;height:40px;">
    		<div style='float:left;width:78px;height:40px;cursor:pointer; background:no-repeat url(../Public/images/child/login.png);' onclick ='toLogin()'></div>
			<div style='float:left;width:78px;height:40px;cursor:pointer; background:no-repeat url(../Public/images/child/register.png);' onclick = 'toRegister()'></div>
    	</div>

    </td>
</tr>
  <tr>
    <td>
    	<div style="background:url(../Public/child/image/head_img.png) no-repeat top center;width:170px;height:185px;margin-top:15px;">
        <img src="../Public/upload/head/{$user.picture}" style="width:170px;height:185px"/>
        </div>
    </td>
  </tr>
   <tr>
    <td ><div  style="background:url(../Public/child/image/ba4detail.png) no-repeat center center;width:180px;height:101px;padding-top:8px;">
    		<div class="de_c" style="color:#717173;font-size:10pt;">生日:{$user.birthday}</div>        
      		<div class="de_c" style="color:#717173;font-size:10pt;">域名:{$user.netweb}.bbt.com</div>
            <div class="de_c" style="color:#717173;font-size:10pt;">注册:{$user.reg_date}</div>              
    	</div>
    </td>
  </tr>
  <tr>
  <tr>
    <td ><div  style="background:url(../Public/child/image/v_line.png) bottom left repeat-x;width:180px;height:2px;"></div></td>
  </tr>
  <tr>
    <td><div style="color:#8C8C8C;font-weight:bold; font-size:12pt;text-align:left;width:180px;padding-top:15px;height:35px;">
      <div style="margin-left:5px;margin-right:2px;">最近来访</div>
</div>   
    </td>
  </tr>
  <tr>
    <td>
   	    <div  id="role" style="float:left;margin-left:20%;background:url(../Public/maincontent1/image/v_line.png) bottom left repeat-x;width:180px;font-size:9pt;">              
              <volist name = "visit" id="visit">
               <div style="width:20%; margin:5%;float:left;">
                  <div><img src="../Public/upload/head/{$visit.picture}" style="float:left;width:33px;height:35px;" onclick="toChild({$visit.u_id})"/></div>
                  <div>{$visit.name}</div>   
              </div> 
	        </volist> 
          
		</div>     
    </td>
  </tr>
</table>
</div>

<img src="../Public/child/image/flower.png" style="position:absolute;right:0;bottom:0px; z-index:-50;" />
</body>
</html>
